{// 引入标签库 }
<tagLib name="fanwe" />
{// 加载头部公共文件 }
<include file="Public:header" />
<load href="__TMPL__ThemeFiles/Js/jquery.js" />
<load href="__TMPL__ThemeFiles/Js/jquery.json.js" />
<load href='__TMPL__ThemeFiles/Css/jqModal.css' />
<load href='__TMPL__ThemeFiles/Js/jqModal.js' />
<load href='__TMPL__ThemeFiles/Js/common.js' />

<!-- 菜单区域  -->
<script language="Javascript">
function releasePromoteCard(promote_id){
	var str=prompt("请输入需要下载优惠券的数量：","50");
	if(isdigit(str) > 0)
	{
		$.ajax({
			  //type: "get",
			  url: "__APP__?m=Promote&a=releasePromoteCard&promote_id="+promote_id + "&num=" + str,
			  success:function(data)
			  {
				dataList = $.evalJSON(data);
				if (dataList != null && dataList != "" && isdigit(dataList) == false){
					var arr = new Array();
					arr = dataList.split(",");
					var	tmp = '优惠券卡号(鼠标右键-->全选,复制)';
					for (var j=0;j< arr.length;j++){
						tmp = tmp + '\n' + arr[j]; 
					}
					alert(tmp);
					
				}else{
					alert("生成优惠券失败："+ dataList);
				}
				location.href = "__APP__?m=Promote&a=listCard&promote_id="+promote_id;
			  }
			});	
		  
	}else{
		if (str != null)
			alert("您刚输入的是："+ str + ' 不是有效的数值');
	}
}
</script>
<!-- 主页面开始 -->
<div id="main" class="main" >

<!-- 主体内容  -->
<div class="content" >
<div class="title">{$Think.lang.DATA_LIST}</div>
<!--  功能操作区域  -->
<div class="operate" >
<fanwe:imageBtn name="add" value="{$Think.lang.PROMOTE_RELEASE_CARD}" click="releasePromoteCard({$promote_id})" style="impBtn hMargin fLeft shadow" />
</div>

</form>
</div>
<!-- 功能操作区域结束 -->

<!-- 列表显示区域  -->
<div class="list" >
<fanwe:list 
	id="checkList" 
	name="promote_card" 
	style="list" 
	order="false"
	datasource="list" 
	show="id:{$Think.lang.ID}|8%,card_name_n:{$Think.lang.PROMOTE_CARD_NAME},card_code:{$Think.lang.PROMOTE_CARD_CODE},card_limit:{$Think.lang.PROMOTE_CARD_LIMIT},card_used:{$Think.lang.PROMOTE_CARD_USED}" 
	/> 
</div>
<!--  分页显示区域 -->
<div class="page">{$page}</div>
<!-- 列表显示区域结束 -->
</div>
<!-- 主体内容结束 -->
</div>
<!-- 主页面结束 -->

